package com.yamvc.mvc.view
{
	import flash.events.EventDispatcher;

	public class View extends EventDispatcher
	{
		private static var _instance:View;
		private var _mediatorsMap:Object = new Object();
		public static function get instance():View{
			if(_instance==null) _instance = new View();
			return _instance;
		}
		public function View(){
			super();
			if(_instance!=null) throw new Error("Singleton error!!");
		}
		
		public function registerMediator(mediatorName:String,mediator:*):void{
			if(_mediatorsMap[mediatorName]==null){
				_mediatorsMap[mediatorName] = mediator;
				mediator.init();
			}
		}
		public function retreaveMediator(mediatorName:String):*{
			return _mediatorsMap[mediatorName];
		}
		
		
		
	}
}